<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <title></title>
</head>

<body>
    <div class="b"></div>

    <script>
        var b = document.getElementsByClassName('b')[0];
        var timego = new Date('2020 10-14 22:00');

        var count_times = setInterval(function () {
            var loacaltime = new Date();
            var times = timego - loacaltime;

            var hao = (times % 1000);
            var sec = parseInt(times / 1000);
            var sescth = (sec % 60);
            var min = parseInt((sec / 60)) % 60;

            var hour = parseInt((sec / 3600)) % 24;
            var days = parseInt((sec / 86400)) % 365;

            var res = '';
            if (hao < 10) {
                res = '00' + hao;
            } else if (hao >= 10 && hao < 100) {
                res = '0' + hao;
            } else {
                res = hao;
            }
            b.innerHTML = "还有" + hour + '时' + min + '分' + res + '毫秒' + "下课";
        }, 1)
    </script>
</body>

</html>